Circuits
About Circuits are editable networks of components that can be used in Custom Rooms in Sandbox room mode to execute basic programs, for example, to keep track of the score, stop the game, and/or announce a winner. These networks are made out of configurable "chips," which can be found on the “Chips” tab of the Maker Pen menu, and specific items from the Sandbox Machine. The pins of the chips can be connected with the Connect tool of the Maker Pen. Visibility of circuits can be controlled in the This Room Menu of the Watch Menu. If you have questions about specific circuits or the system in general, don't hesitate to ask them in the #circuits channel of Against Gravity's discord. Examples of Circuits Several examples of useful circuits are documented in Circuit Diagrams. You can see some circuits in Rec Room by going to these Custom Rooms: * ^CircuitAcademy * ^circuitdemo * ^circuitrecipes * ^highscorecircuit * ^buzzercircuit * ^powcircuit * ^randomspawncircuit * ^jdCalculator * ^hackerspace * ^elektronicbowling To find these rooms, open your Watch Menu, click on the Custom Rooms Menu and then the Search tab. Click on "Enter name here," type in the name, and then click the "Search" button. Some of the rooms are also accessible via the custom room ^FeaturedRooms. Chips This section describes all chips that are available in the "Chips" tab of the Maker Pen menu. You might have to turn on visibility of circuits in the This Room Menu of the Watch Menu to get access to this tab. The pins of the chips can be connected with the Connect tool of the Maker Pen. In general, input pins to a chip are on the left, and output pins from the chip are on the right. Input pins that are not connected to anything receive a 0 signal ("false"). A "true" signal (any number unequal to 0) on "R" pins will reset a chip, i.e., produce a 0 output. Examples of circuits with most of these chips are on the page Circuit Diagrams. Variable Variable chips hold three integer numbers that are available as output on the pins on the right side. You can set the values with the Settings tool of the Maker Pen. Combinator Combinator chips do mathematical operations on inputs. Currently, addition, subtraction, multiplication, division and modulo (remainder after division) operations are supported. You can set the operation with the Settings tool of the Maker Pen. A common application of the addition operation is to increment a score. Note that to increment a score, you need to connect the output of the chip to one input in order to add the new score to it. A common application of the modulo operation is to toggle between 0 and 1: by computing an input value modulo 2, the result will toggle between 0 and 1 if the input is incremented in steps of 1. Comparer Comparer chips do mathematical comparisons between the red input signal and the green input signal, including equals, not equals, greater than and less than operations. If "Advanced Mode" is not(!) checked in the settings, the red output ("if") is 1 if the comparison is "true" and 0 if it is "false", while the green output ("else") has the negated value. In "Advanced Mode" the red output has the value of the cyan input if the comparison is "true" and 0 if it is "false", while the green output ("else") has the value of the pink input if the comparison is "false" and 0 otherwise. You can set the comparison and the mode with the Settings tool of the Maker Pen. Output Output chips display the numeric value input on the red pin on the left. Message Message chips display a message to all players in a room when the input pin on the left is set to "true", i.e., any number unequal to 0. The message can be edited with the Settings tool of the Maker Pen. This can be controlled via buttons or other circuit components. Timer Timer chips can be used in countdown or looping countdown mode. The red pin on the left is an on/off switch; the timer must be held in an “on” state (signal unequal to 0) to operate; thus, a button press, which only sends a momentary 1, cannot run a timer on its own. The green pin is an input for the amount of time (in seconds) that a timer should operate. The red pin on the right outputs a momentary signal 1 when the timer expires (similar to goals and buttons). The green pin on the right is the current time left on a countdown. Delay Delay chips take a signal passed on the red pin, wait the amount of time provided by the green pin (in circuit ticks, i.e. 10th of seconds), and then output the signal from the red input pin momentarily on the red output pin before outputting 0 again, even if the input stays on a different value. It will emit a pulse again, if the input value changes to a different non-zero value. The minimum delay time (green input) is 1, even if you don't connect anything to the delay input. If new signals come in before the last one is put out, the delay chip buffers the latest 20 signals (value + delay) and outputs them in the correct order. Boolean Boolean chips act as logic gates, supporting "And", "Or", and "Not" operations. The output is a "true" (1) or "false" (0) signal on the right side. For "And", the output is "true" (1) if and only if all applied input signals are "true" (unequal to 0). For "Or" the output is "true" (1) if and only if any of the applied input signals is "true" (unequal to 0). For "Not", the output is "true" (1) if and only if the input signal is "false" (0). You can set the operation with the Settings tool of the Maker Pen. SFX When the input receives a True signal, the sound effect set is played. You can change the sound effect played by using edit mode of the maker pen. The sounds effects available are: Random When the red node gets a True signal, the random chip generates a steady output with a random number in the range from the green input (inclusive) to the blue input (exclusive). In other words, the value from the green input can appear, the value from the blue input cannot appear. To roll numbers from 1 to 6, input 1 to green and 7 to blue. The chip keeps outputting the last rolled number until a new number is rolled. A new number is rolled when any circuit element (including buttons) causes any circuit update and the red input has a true value at the same time. See Global Chip Update Tick for more detailed information about this behavior. Selector Chip The selector chip has two modes that can be set with the Settings tool of the Maker Pen: "First" and "All". The selector chip compares the red input signal with the numbers of output pins that are specified in the settings of the chip. If the mode is set to "First", the chip sends the green input signal to the first output pin that has the same number as the red input signal. All other output pins are set to 0. If the mode is set to "All", the chip sends the green input signal to all output pins that have the same number as the red input signal. Again, all other output pins are set to 0. Player Hit The player hit node can be used to detect who hits someone, and who is hit, and by how much damage. Red outputs the player ID of the attacker, green the player ID of the defender, blue the team ID of the attacker, cyan the team ID of the defender, and red the damage of the attack. Other than in other game modes, the damage of weapons is currently constant in sandbox rooms. It does not take into account factors like distance for grenade launchers or how far a bow has been pulled. Shotguns pallets are not considered each on their own, but only one per hit player, which leads to comparably very low damage for shotguns. Chips are only evaluated about every 10th of a second, but the player hit chip appears to be buffered and therefore does not miss any hits, for example when hitting two players at the same time (with grenades or shotguns). The hit chip outputs both hits in sequence. Weapon damages: In this table -- denotes that the attack will not cause the player hit chip to output anything, while 0 is a regular hit with no damage. The reduced damage column applies when a weapon or shield (paintball, quest or soccer shield) is hit. Weapon by damage: b stands for Base damage, r for Reduced damage, and c for Critical damage. Respawn The red input (respawn player on team node) respawns the player with the ID of the input signal on a valid respawn point. The green input respawns the entire team, where a signal of 1 is the blue team and 2 the red team and -1 for both teams. Game State Sends a momentary output of 1 on the appropriate pin when the game state changes: * Red = Game Start * Green = Game End * Blue = Pre-Game Start Bugs: The red and green pins output a 1 for one tick, the blue output outputs a 1 for two ticks. Start Game A signal greater than 0 on the red pin starts the game when any of the input signals changes. A signal greater than 0 on the green pin stops the game when any of the input signals changes. Score Scores from the scoreboard are output on the Red and Green pins for the Red and Blue teams respectively. This can be used to make announcements about the score. Set Score A Set Score chip's input on the Red pin will display on the scoreboard as red team’s score, and the input on the Green pin will display the blue team’s score. Other Objects with Inputs There are many objects from the Sandbox Machine which take circuit signals using arrows attached to the objects while circuit visibility is true. These objects take a value from an output pin and process it accordingly. Sign The sign can display one of 5 text messages that can be set with the Settings tool of the Maker Pen. The cyan input signal determines which message is displayed (0 to 4). Use "{R}", "{G}", and "{B}" in the text messages to display the value of the red, green, and blue input signals. Room Door When the red input arrow is receiving a True value (any value other than 0), the door is locked. Sampler Samplers can play recorded audio clips of up to 15 seconds. Red input: "Play on Signal"; green input: "Playback Speed"; blue input: "Volume (Max 10)". The default volume when unconnected, or outside the range of 1-10, is 10. The playback speed can be calculated using the formula |g/10 + 1|. Do not use values lower than -23, as that causes the sampler to stop working and the game to lag heavily. The maximum valid value appears to be 200, values higher than that are interpreted as 200 as well. Holotar Projector When the green input arrow receives a True value, the holotar starts playback. When the red input arrow receives True, the holotar stops playback. Respawn Point When a player ID is passed to the red input arrow, the player with that ID is respawned at the point. The green input arrow sets which team the respawn point belongs to, so that you can actively change it in a game. 1 is blue, 2 is red, and any other value is both/no teams. A default can also be set through the settings menu of the maker pen. Radio There are two radios: the radio and the ambience radio. When the red input arrow receives a true value, the radio starts or stops. Bugs: Currently it is a bad idea to control the radio by circuits for rooms that allow more than 1 player. The state of the radio (playing/stopped) is purely client based and will always start in the playing state for a player when he enters a room. If the actual/supposed state is stopped, the radio status will always appear reversed to the player. Another problem appears when a client misses the chip tick that is supposed to change the radio's state, then that client's radio will be out of sync, too. Additionally a stopped radio will start playing again if the player that has been in the room the longest leaves. The songs available to you on each radio are: Other Objects with Outputs These objects output various values when physically interacted with. Button Depending on the settings, the red output is set either to a momentary 1 or the player ID when the button is pressed. The green output is set either to a ticking 1 or the player ID while the button is pressed. The blue output is set either to a momentary 1 or the player ID when the button is released. Object Goal When an object passes through the goals, the red output arrow outputs a momentary 1. Player Goal When a player passes through the goal, the red output arrow outputs a momentary 1. Disc Golf Goal When a disc hits the goal, the red output arrow outputs a momentary 1. Dice When a dice rolls, the connection outputs the value of the roll momentarily. You could use a pulse to steady conversion circuit or a copy value circuit to store the dice roll result. Trigger Zone Trigger zones are one of the shapes that can be created with the Maker Pen. They have two modes that can be set with the Settings tool of the Maker Pen: either they keeping track of players or of objects. If tracking players, the red pin outputs 0, or the player ID of a player who just entered the zone. The green pin outputs the number of players in the zone. The blue pin outputs 0, or the player ID of a player who just exited the zone. If tracking objects, the red pin outputs 0, or 1 if an object just entered the zone. The green pin outputs the number of objects in the zone. The blue pin outputs 0, or 1 if an object just exited the zone. Pitfalls The current version of the game has some known pitfalls that can be hard to understand or find if not known. Connecting Frozen Objects Connecting frozen objects is currently not possible. You have to unfreeze both objects with the Settings tool of the Maker Pen before connecting them. Value Range Circuits currently support only 32-bit singed integers. They range from −2,147,483,648 to 2,147,483,647 and cannot produce fractions or real numbers. Ring Evaluation Order Rings that consist of more than one chip do not have a defined evaluation entry point. That means the chip inside the ring store that gets evaluated first cannot be defined designing the circuit. Therefore they sometimes get evaluated in an unexpected order. For example the Number Pad often produces a 0 too much at the end (i.e. the result is 10 times what it should be). If the execution order of the chips inside a ring appears wrong, it helps to exchange the chips in the ring. To do so, swap the chip that appears to be executed first with the chip that should be executed first. Then swap their functions and connections. The result is the exact same circuit, only that the chips that execute the steps are different ones. The ring should then be evaluated in the desired order. Global Chip Update Tick Isle of Lost Skulls Update: Currently this issue only affects random number generator chips. Locomotion Update: No change. Pizza & Potions Update: No change. The first example on the right demonstrates the issue. Note that the button is not connected to anything at all. Every time the button gets pressed, the output increases by 2. All chips in one room are evaluated every time any chip gets evaluated; otherwise they are usually not evaluated. The result may be confusing and counterintuitive - in particular if you rely on this "lazy" evaluation. For example a ring store that has an external input signal usually does not change until a signal is triggered. However, it does change when an unrelated signal in an unrelated circuit in the same room gets triggered. If you encounter values that appear to be changing randomly while building a circuit or when triggering signals at the other end of the room, this is probably the reason. The simplest way to reproduce this issue is to build an alternating circuit, for example by connecting the output of a Not chip to its input and observing the output. Currently there is no known workaround for this issue, other than designing the circuits in a way that they are not affected by it. (For an example, see the two variants of the Copy Value circuit: the first one is not affected by the issue but takes one more tick to perform its function.) According to Against Gravity, this issue is not a bug but a expected behavior. However they understand that it is confusing and are considering to change the expectation. To help you building circuits in a way that they are not affected by the global update, you can add the circuit on the right to your room during construction. It will constantly induce chip updates (about 10 per second), so you will notice problems in your design early. Category:Tools